package org.example.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.example.domain.po.*;
import com.baomidou.mybatisplus.extension.service.IService;
import org.example.domain.vo.ErpDepotHeadPurchaseVo;
import org.example.domain.vo.ErpDepotHeadRetailVo;

import java.util.List;

/**
* @author 24059
* @description 针对表【erp_depot_head(单据主表)】的数据库操作Service
* @createDate 2024-10-17 11:02:58
*/
public interface ErpDepotHeadService extends IService<ErpDepotHead> {
public Page<ErpDepotHead> selectByExample(Page<ErpDepotHead> page, @Param("number")String number, @Param("color")String color, @Param("createTime")String createTime, @Param("operTime")String operTime, @Param("username")String username, @Param("name")String name, @Param("status")String status, @Param("remark")String remark, @Param("standard")String standard,@Param("supplier") String supplier,@Param("tenantId") Long tenantId);

public int updateOrderStatus(@Param("ids") List<Integer> ids, @Param("status") String status);
public int insertdd(ErpDepotHead erpDepotHead);


    Page<ErpDepotHead> findPage(Page<ErpDepotHead> erpDepotHead,
                                @Param("number") String number,
                                @Param("status") String status,
                                @Param("type") String type,
                                @Param("subType") String subType,
                                @Param("depId")Long depId,
                                @Param("organId")Long organId,
                                @Param("userId")Long userId,
                                @Param("createTime")String createTime,
                                @Param("endTime")String endTime,
                                @Param("model")String model
    );
    Page<ErpDepotHead> selectOderck(Page<ErpDepotHead> page, @Param("number")String number,
                                    @Param("accountname")String accountname,
                                    @Param("color")String color, @Param("createTime")String createTime,
                                    @Param("operTime")String operTime, @Param("username")String username,
                                    @Param("name")String name, @Param("status")String status,
                                    @Param("remark")String remark,
                                    @Param("standard")String standard,@Param("supplier") String supplier,@Param("changeAmount")String changeAmount,@Param("dname")String dname,@Param("debt")String debt,@Param("tenantId") Long tenantId);
    Page<ErpDepotHead> selectOderth(Page<ErpDepotHead> page, @Param("number")String number,@Param("discountLastMoney") String discountLastMoney,
                                        @Param("accountname")String accountname,
                                        @Param("color")String color, @Param("createTime")String createTime,
                                        @Param("operTime")String operTime, @Param("username")String username,
                                        @Param("name")String name, @Param("status")String status,
                                        @Param("remark")String remark,
                                        @Param("standard")String standard,@Param("supplier") String supplier,@Param("changeAmount")String changeAmount,@Param("dname")String dname,@Param("debt")String debt,@Param("tenantId") Long tenantId);
    Long finbyid(@Param("number")String number);
    int updateOrder(ErpDepotHead erpDepotHead,@Param("id")Long id);
    Page<ErpDepotHead>selectOut(Page<ErpDepotHead> page, @Param("number")String number,
                                @Param("createTime")String createTime, @Param("operTime")String operTime,@Param("standard")String standard,@Param("id") Long id,@Param("subType") String subType,@Param("tenantId") Long tenantId);
    Page<ErpDepotHead>selectOut2(Page<ErpDepotHead> page, @Param("number")String number,
                                 @Param("createTime")String createTime, @Param("operTime")String operTime,@Param("standard")String standard,@Param("organId") Long organId);
    Page<ErpDepotHead>RetailOut(Page<ErpDepotHead> page, @Param("number")String number,
                                @Param("createTime")String createTime, @Param("operTime")String operTime,@Param("standard")String standard,@Param("id") Long id,@Param("subType") String subType);

    int insertck(ErpDepotHead erpDepotHead);
    List<ErpDepotHead>findherfid(@Param("headerId")Long headerId);
    int updateOrderStatus2(@Param("linkNumber") String linkNumber);

    boolean updateDelete(List<Integer> ids, String status);
    boolean updateStatus(List<Integer> ids, String status);
    Long lookByHeaderId(@Param("linkNumber")String linkNumber);
    int updateOrderStatus3(@Param("linkNumber") String linkNumber);


    Page<ErpDepotHeadPurchaseVo> PurchaseFindByPage(Page<ErpDepotHeadPurchaseVo> page, Purchase purchase, Long tenantId);
    int deprotinsert(ErpDepotHead erpDepotHead);
    Page<ErpDepotHead>selectOutth(Page<ErpDepotHead> page, @Param("number")String number,
                                  @Param("createTime")String createTime, @Param("operTime")String operTime,@Param("standard")String standard,@Param("id") Long id);
    int depotinserttwo(ErpDepotHead erpDepotHead);


    int insertPurchase(DepotRequest depotRequest, ErpUser user);

    int updateDepotHead(@Param("depotHead")ErpDepotHead erpDepotHead,@Param("number")String number);

    Page<ErpDepotHeadRetailVo> select1(Page<ErpDepotHeadRetailVo> page, @Param("retail") Retail retail,Long tenantId);
    Page<ErpDepotHeadRetailVo>select2(Page<ErpDepotHeadRetailVo> page, @Param("retail") Retail retail,Long tenantId);
    Long  select7(@Param("id") Long id);
    List<Long>  select8(@Param("headerId") Long headerId);
    Long  select9( @Param("linkIds") List<Long> linkIds);
    int updateRetail4(@Param("id") Long id,@Param("status") String status);
    int depotinsertdb(ErpDepotHead erpDepotHead);
    String  select10(@Param("headerId") Long headerId);
    int deleteRetail(@Param("id") Long id);

    Page<ErpDepotHead> selectByqtrk(Page<ErpDepotHead> page);
    Page<ErpDepotHead> select3(Page<ErpDepotHead> page);

    boolean modifyTheState(List<Integer> ids, String status);
    Long RetailInDetail(@Param("linkId") Long linkId);
    Long RetailIn(@Param("id") Long id);
    int updateRetail(@Param("id") Long id);
    int updateRetail3(@Param("id") Long id);
    Long RetailInDetailty(@Param("id") Long id);
    String select4(@Param("id") Long id);
    Long  select5(@Param("number") String number);
    Long  select6(@Param("linkNumber") String linkNumber);

}


